const axios = require("axios");
// const http = require("http");

const get = function(url, config) {
  return axios.get(url,config).then((response)=>{
    const { data, status, statusText } = response;
    if (status == 200 || status == 304) {
      return data;
    } 
      throw new Error(statusText);
  })
};

export const getHotSound = function() {
  return get("/mobileWeb/newHomepage3");
};

export const getMusic = function(){
  return get("/sound/newhomepagedata");
}

export const getTagAlbum = function(){
  return get("/explore/tagalbum",{
    params:{
      order:0
    }
  })
}

export const getCatalog = function(){
  return get("/mobileWeb/catalogroot");
}